package org.eclipse.cdt.utils.pty;

import java.io.IOException;

public class TerminalFactory {

	static private TerminalFactory instance;
	
	private TerminalFactory() {
	}
	
	public static TerminalFactory getFactory() {
		if (instance == null) {
			instance = new TerminalFactory();
		}
		return instance;
	}
	
	public Terminal createTerminal(boolean console) throws IOException {
		if (PTY.isSupported()) {
			return new PTY(console);
		} else {
			return new SoftTerminal(console);
		}
	}
}
